package cn.bonoon.kernel.security;

import cn.bonoon.kernel.menus.ChannelInfo;
import cn.bonoon.kernel.menus.ItemInfo;
import cn.bonoon.kernel.menus.MenuInfo;
import cn.bonoon.kernel.menus.TabInfo;
import cn.bonoon.kernel.menus.TabItem;

public interface PrivilegeChecker extends ChannelPrivilege {
	PrivilegeChecker ALL = new PrivilegeChecker() {

		@Override
		public boolean hasPrivilege(ChannelInfo channel) {
			return true;
		}

		@Override
		public boolean hasPrivilege(MenuInfo menu) {
			return true;
		}

		@Override
		public boolean hasPrivilege(ItemInfo item) {
			return true;
		}

		@Override
		public boolean hasPrivilege(TabInfo tsi) {
			return true;
		}

		@Override
		public boolean hasPrivilege(TabItem item) {
			return true;
		}

	};

	boolean hasPrivilege(MenuInfo menu);

	boolean hasPrivilege(ItemInfo item);

	boolean hasPrivilege(TabInfo tab);

	boolean hasPrivilege(TabItem item);

}
